In computer security applications, a computer program code is analyzed in an attempt to detect vulnerabilities or malicious computer programs in the computer program code. The analysis may be directed to computer program libraries that may be defined as an implementation of one or more basic functions that may be used by higher level programs. Libraries enable reuse of the basic functions by multiple independent computer programs, thus improving the efficiency of the computer programming. The analysis may comprise detecting the libraries from a binary code. A conventional solution has been to search for character strings such as letters or numbers from bytes of the binary code. One problem with such a solution is that there exist libraries that do not necessary contain any eligible character strings. Libraries may be detected in other applications, as well, e.g. when determining software licensing status of a computer program.